package com.xb.cloud.product.service.business.model.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.xb.cloud.common.client.bo.UpdateInfo;
import com.xb.cloud.order.service.client.bo.SoSkuSummeryBo;
import com.xb.cloud.product.merchant.service.client.bo.ProductSkuBo;
import com.xb.cloud.product.merchant.service.client.bo.ShopSkuBo;
import com.xb.cloud.product.service.business.model.ProductSku;
import com.xb.cloud.product.service.business.model.ProductSkuExample;
import com.xb.cloud.product.service.business.model.ProductSkuExamplePaged;
import com.xb.cloud.product.service.client.bo.SkuBO;

public interface ProductSkuMapper {
	long countByExample(ProductSkuExample example);

	int deleteByExample(ProductSkuExample example);

	int deleteByPrimaryKey(Long id);

	int insert(ProductSku record);

	int insertSelective(ProductSku record);

	List<ProductSku> selectByExample(ProductSkuExample example);

	ProductSku selectByPrimaryKey(Long id);

	int updateByExampleSelective(@Param("record") ProductSku record, @Param("example") ProductSkuExample example);

	int updateByExample(@Param("record") ProductSku record, @Param("example") ProductSkuExample example);

	int updateByPrimaryKeySelective(ProductSku record);

	int updateByPrimaryKey(ProductSku record);

	List<ShopSkuBo> getShopSkuListBySkuIds(List<Long> skuIds);

	List<SkuBO> getSkuByBackendCategoryList(Map<String, Object> criteriaMap);

	/**
	 * 计算在售、仓库中的 sku的列表
	 * 
	 * @param skuExamplePaged
	 * @return
	 */
	int countSkuListByIsCanSale(ProductSkuExamplePaged skuExamplePaged);

	/**
	 * 查询在售、仓库中的 sku的列表[分页]
	 * 
	 * @param skuExamplePaged
	 * @return
	 */
	List<ProductSkuBo> selectSkuListByIsCanSale(ProductSkuExamplePaged skuExamplePaged);

	/**
	 * 根据skuId列表查询sku信息和价格信息
	 * 
	 * @Title getSkuWithPriceBySkuIds
	 * @param skuid
	 * @return
	 */
	List<ProductSkuBo> getSkuWithPriceBySkuIds(List<Long> skuIdList); 
	int countSkuListByGroup(ProductSkuExamplePaged skuExamplePaged);

	/**
	 * 查询当前分组下的sku列表数量
	 * @param skuExamplePaged
	 * @return
	 */
	List<ProductSkuBo> selectSkuListByByGroup(ProductSkuExamplePaged skuExamplePaged);

	/** 
	 * @param sellOrderSkuBoList
	 * @param updateInfo
	 */
	int  batchUpdateTotalSaleAmout(@Param("list") List<SoSkuSummeryBo> sellOrderSkuBoList, @Param("updateInfo") UpdateInfo updateInfo);
	
}